<!doctype html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta charset="utf-8">
    <title>无标题文档</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/main.css">
   
    
</head>

<body>
    <!-- 公用头部导航 -->
    <nav class="nav">
        <a class="goback" href="javascript:history.back(1)"></a>
        <div class="nav-title">推荐旅游目的地</div>
        <div class="navright">
            <a href="#" class="email"></a>
            <a href="#" class="daka">打卡</a>
        </div>
    </nav>
    <div class="search">
        <div class="searchIcon"></div>
        <input type="text" placeholder="搜索你想去的地方">
    </div>
    <div class="picTop">
        <p><span>诗情画意，</span>山水中的彩墨美学</p>
        <ul id="sqhy">
            <!-- 在此处添加并修改结构代码，参考以下注释文档 -->
            <!-- <li><a href="javascript:void(0);"><img src=""><span></span></a></li> -->
        </ul>
    </div>
    <div class="picBottom">
        <p><span>一朝花枝俏，</span>且行且趋早</p>
        <ul id="yzhzq">
            <!-- 在此处添加并修改结构代码，参考以下注释文档 -->
            <!-- <li><a href="javascript:void(0);"><img src=""><span></span></a></li> -->
        </ul>
    </div>
</body>

</html>
<script src="./js/axios.min.js"></script>
<script>
    var sqhy=document.getElementById('sqhy');
    var yzhzq=document.getElementById('yzhzq');
    axios({
                method: 'post',
                url: 'http://127.0.0.1:8080/h8/travel/list'
            })
            .then(res => {
                    if (res.status === 200) {
                        if (res.data.success) {
                            for (var i in res.data.list) {
                                if(res.data.list[i].topic==='诗情画意'){
                                    sqhy.innerHTML+=`<li><a href="javascript:void(0);"><img src="http://127.0.0.1:8080/h8${res.data.list[i].imagePath}"><span>${res.data.list[i].name}</span></a></li>`
                                }else{
                                    yzhzq.innerHTML+=`<li><a href="javascript:void(0);"><img src="http://127.0.0.1:8080/h8${res.data.list[i].imagePath}"><span>${res.data.list[i].name}</span></a></li>`
                                }
                            }
                        }
                    }
                })
    
</script>